//
//  java_chat.java
//  java-chat
//
//  Created by Joe Simpson on 26/08/2009.
//  Copyright (c) 2009 __MyCompanyName__. All rights reserved.
//
//  A simple signed Java applet
//
// this file is *NOT* javadoc comaptable
// this is because it doesn't need to be
// us @ mashmash know what we're doing with it :D

import java.awt.*;
import java.applet.*;
import javax.swing.*;

// this is the little applet we use
// it's got baaic use of the Chat class and javascript calling
// you shouldn't copy it exactly because it won't work
public class java_chat extends JApplet {
	
    static final String message = "mashmash Chat Test Client";
    private Font font = new Font("serif", Font.ITALIC + Font.BOLD, 36);
	Chat chatClient = new Chat();
	
    public void init() {
        // set the default look and feel
        String laf = UIManager.getSystemLookAndFeelClassName();
        try {
            UIManager.setLookAndFeel(laf);
        } catch (UnsupportedLookAndFeelException exc) {
            System.err.println ("Warning: UnsupportedLookAndFeel: " + laf);
        } catch (Exception exc) {
            System.err.println ("Error loading " + laf + ": " + exc);
        }
		// Please note: THIS KEY WILL ONLY WORK FOR IT RUNNING ON OUR SITE
		// anything other than that and it will want to open up a page saying to the user
		// "The developer of this app is stupid. They used the Java Client Key"
		// So don't make a fool of yourselves!
		chatClient.authUser("08a2a9b6553be43d1ce4eebf654a90cf96d4c7ac");
		getContentPane().setLayout (null);
    }
	
    public void paint (Graphics g) {
        super.paint(g);
        g.setColor(Color.blue);
        g.setFont(font);
        g.drawString(message, 40, 80);
    }
}
